<?php
include "../librari/koneksi.php";

if (!isset($_POST['box']))
{
	//If not isset -> set with dumy value
	$_POST['box'] = "undefine";
}

$box=$_POST['box'];
if ($box!="undefine"){
	$str =  implode(", ", $box);

	//echo isset($box);
	//echo $str;
	
	//update data
	$sql = " UPDATE pelamar SET is_lolos=1 where idPelamar in ($str)";
	//echo $sql;
	mysql_query($sql);

	//update data
	$sql2 = " UPDATE pelamar SET is_lolos=0 where idPelamar not in ($str)";
	//echo $sql;
	mysql_query($sql2);
}else{
	$sql3 = " UPDATE pelamar SET is_lolos=0";
	//echo $sql;
	mysql_query($sql3);
}
	 echo "<script language='JavaScript'>document.location='data_pelamar.php';
	alert('Sukses. Klik OK!');
	</script>";

?>